import { createStore, applyMiddleware } from "redux"
import thunk from "redux-thunk"
import { composeWithDevTools } from "redux-devtools-extension"
import reducers from "./reducers"

console.log(process.env.NODE_ENV)

let middware
if (process.env.NODE_ENV === "production") {
  middware = applyMiddleware(thunk) // 排除打包 因为生产环境不使用开发工具
} else {
  middware = composeWithDevTools(applyMiddleware(thunk))
}
export default createStore(reducers, middware)
